package br.ufmg.dcc.vod.remoteworkers.util;

public class PreRaceControlledCommand extends RaceConditionCommand {

	private final SyncQueueBasedLock lock;
	
	public PreRaceControlledCommand(SyncQueueBasedLock lock) {
		this.lock = lock;
	}
	
	@Override
	public Integer process() throws Exception {
		lock.lock(); //wait until execution
		lock.lock(); //wait for race
		return super.process();
	}
}
